$("#mdbtn").click(function(){
    var type = $("#mdtypesel option:selected").val();
    var title = $("#mdtitle").val();
    var summary = $("#mdsummary").val();
    var content = $("#mdcontent").val();
    $.post("/api/submitmd",{"type":type,"title":title,"summary":summary,"content":content},function(data) {
        if (data==1) {
            $("#restip").html('<div class="alert alert-success" role="alert">submit success!</div>');
        }
        else {
            $("#restip").html('<div class="alert alert-danger" role="alert"  align="center">something wrong</div>');
        }
    });
});

$("#htmlbtn").click(function(){
    var type = $("#htmltypesel option:selected").val();
    var title = $("#htmltitle").val();
    var summary = $("#htmlsummary").val();
    var content = $("#htmlcontent").val();
    $.post("/api/submithtml",{"type":type,"title":title,"summary":summary,"content":content},function(data) {
        if (data==1) {
            $("#htmlrestip").html('<div class="alert alert-success" role="alert">submit success!</div>');
        }
        else {
            $("#htmlrestip").html('<div class="alert alert-danger" role="alert"  align="center">something wrong</div>');
        }
    });
});

$("#minderbtn").click(function () {
    $.get("/admin/minder",function (data) {
        $(".container").html(data);
    });
});